<template>
  <div>
    <h1>表格动态表头</h1>
    <el-table
        :data="tableData"
        border
        style="">
      <el-table-column
          v-for="(item, index) in columnData"
          key="index"
          :prop="item.prop"
          :label="item.text"
          align="center"
      >
        <template>

        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: "Table2",
  data() {
    return {
      columnData: [
        {prop: "idx", text: "序号",},
        {prop: "uname", text: "姓名",},
        {prop: "gender", text: "性别",},
        {prop: "age", text: "年龄",},
        {prop: "school", text: "毕业院校",},
      ],
      tableData: [
        {idx: "10001", uname: "张三", gender: '男', age: 19, school: "武大"},
        {idx: "10002", uname: "李四", gender: '女', age: 21, school: "北大"},
        {idx: "10003", uname: "陈波", gender: '男', age: 20, school: "清华"},
        {idx: "10004", uname: "汪兵", gender: '女', age: 18, school: "华科"},
      ],

    }
  },
}
</script>

<style>

</style>